<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Fullpage案例</title>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.12/fullpage.css"
    />
  </head>
  <style>
    #myMenu {
      position: fixed;
      right: 40px;
      top: 20%;
      z-index: 999;
      /* display: none; */
      text-align: right;
      list-style: none;
    }
    #myMenu li {
      line-height: 2;
      margin: 0;
      padding-left: 20px;
      display: block;
      position: relative;
      overflow: hidden;
      float: none;
    }
    .section {
      overflow: hidden;
    }
    #myMenu li a {
      display: block;
      position: relative;
      font-family: cursive;
      font-size: 18px;
      font-size: 12px \9;
      letter-spacing: 2px;
      text-align: left;
      line-height: 30px;
      padding: 10px 0;
      transition: all 0.5s linear;
      text-align: left;
      padding: 5px 0;
      color: #000;
      font-weight: bolder;
      opacity: 0.6;
    }
    #section0 {
      background-image: url(https://oss-yangjh.oss-cn-chengdu.aliyuncs.com/images/20221107113958.png);
    }
    #section1 .layer {
      position: absolute;
      z-index: 4;
      width: 100%;
      left: 0;
      top: 43%;
      transform: translate3d(0, 0, 0);
      overflow: hidden;
      color: beige;
    }
    #myVideo {
      position: absolute;
      right: 0;
      bottom: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-size: 100% 100%;
      background-color: black; /* in case the video doesn't fit the whole page*/
      background-image: /* our video */ ;
      background-position: center center;
      background-size: contain;
      object-fit: cover; /*cover video background */
      z-index: 3;
    }
  </style>
  <body>
    <ul id="myMenu">
      <li data-menuanchor="firstPage" class="active">
        <a href="#firstPage">First section</a>
      </li>
      <li data-menuanchor="secondPage">
        <a href="#secondPage">Second section</a>
      </li>
      <li data-menuanchor="thirdPage">
        <a href="#thirdPage">Third section</a>
      </li>
      <li data-menuanchor="fourthPage">
        <a href="#fourthPage">Fourth section</a>
      </li>
    </ul>
    <div id="fullpage">
      <div class="section" id="section0" data-anchor="firstPage">
        Some section
      </div>
      <div class="section" id="section1" data-anchor="secondPage">
        <video id="myVideo" loop muted data-autoplay playsinline>
          <source
            src="https://oss-yangjh.oss-cn-chengdu.aliyuncs.com/video/d5a4b96f-01b4-4519-8470-62484e0b1b5b.mp4"
            type="video/mp4"
          />
        </video>
        <div class="layer">
          <h1>fullPage.js videos</h1>
        </div>
      </div>
      <div class="section" data-anchor="thirdPage">
        <h1>页面标题</h1>
      </div>
      <div class="section" data-anchor="fourthPage">Some section</div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.12/fullpage.min.js"></script>
    <script type="text/javascript">
      var myFullpage = new fullpage("#fullpage", {
        sectionsColor: ["#4BBFC3", "#7BAABE", "whitesmoke", "#ccddff"],
        anchors: ["firstPage", "secondPage", "thirdPage", "fourthPage"],
        // navigation: true,
        slidesNavigation: true,
        // showActiveTooltip: true,
        verticalCentered: false,
        credits: null,
        menu: "#myMenu",
      });
    </script>
  </body>
</html>
